package com.dg.param;

import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

@Data
public class UserParam {

    private Integer id;

    @NotBlank(message = "用户名不能为空")
    @Length(min = 1, max = 20, message = "用户名长度需要在1~20之间")
    private String username;

    @NotBlank(message = "手机号码不能为空")
    @Length(min = 1, max = 13, message = "手机号码长度需要在1~13之间")
    private String phone;

    @NotBlank(message = "密码不能为空")
    @Length(min = 6, max = 30, message = "密码长度需要在6~30之间")
    private String password;

    @NotNull(message = "部门id不能为空")
    private Integer deptId;

    @Min(value = 0, message = "状态最小为0")
    @Max(value = 2, message = "状态最大为2")
    @NotNull(message = "状态不能为空")
    private Integer status;

    @Length(max = 200, message = "备注长度必须在200个字之内")
    private String remark;


}
